# -------------------------------------------------
# Project created by QtCreator 2011-02-16T11:54:26
# -------------------------------------------------
QT += core \
    gui \
    opengl \
    phonon \
    xml

TARGET = GLInterface
TEMPLATE = app

CONFIG += embed_manifest_exe

# EBN datatype
# Now with more robust environment enforcement!
EBN_INCLUDE = $$(EBN_INCLUDE)
!isEmpty (EBN_INCLUDE) {
    INCLUDEPATH += "$$(EBN_INCLUDE)"

    # Link to the library
    EBN_LIB = $$(EBN_LIB)
    !isEmpty (EBN_LIB) {
        LIBS += "$$(EBN_LIB)/Ebn.lib"
    } else {
        error("EBN library was not linked in the environment! Add the appropriate EBN_LIB variable to the compilation environment")
    }
} else {
    error("EBN headers were not included in the environment! Add the appropriate EBN_INCLUDE variable to the compilation environment")
}

# RobotPose datatype
# Now with more robust environment enforcement!
ROBOT_POSE_INCLUDE = $$(ROBOT_POSE_INCLUDE)
!isEmpty (ROBOT_POSE_INCLUDE) {
    INCLUDEPATH += "$$(ROBOT_POSE_INCLUDE)"

    # Link to the library
    ROBOT_POSE_LIB = $$(ROBOT_POSE_LIB)
    !isEmpty (ROBOT_POSE_LIB) {
        LIBS += "$$(ROBOT_POSE_LIB)/RobotPose.lib"
    } else {
        error("RobotPose library was not linked in the environment! Add the appropriate ROBOT_POSE_LIB variable to the compilation environment")
    }
} else {
    error("RobotPose headers were not included in the environment! Add the appropriate ROBOT_POSE_INCLUDE variable to the compilation environment")
}
#INCLUDEPATH += "C:/Projects/RobotPose"
#CONFIG(debug, debug|release) {
#    LIBS += "C:/Projects/RobotPose-build-desktop/debug/RobotPose.lib"
#} else {
#   LIBS += "C:/Projects/RobotPose-build-desktop/release/RobotPose.lib"
#}

KINECT_CHECK = $$(KINECT)
!isEmpty (KINECT_CHECK) {
    DEFINES *= KINECT
}

# Kinect
# Should we build with Kinect support?
contains (DEFINES, KINECT) {
    message("Building with Kinect support")

    # Check for Kinect wrapper class inclusion
    KINECT_INCLUDE = $$(KINECT_INCLUDE)
    !isEmpty (KINECT_INCLUDE) {
        INCLUDEPATH += "$$(KINECT_INCLUDE)"
        KINECT_LIB = $$(KINECT_LIB)
        !isEmpty (KINECT_LIB) {
            LIBS += "$$(KINECT_LIB)/Kinect.lib"
        } else {
            error("Kinect library was not linked! Add KINECT_LIBS to the compilation environment")
        }
    } else {
        error("Kinect headers were not included! Add KINECT_INCLUDE to the compilation environment")
    }

    # Check for OpenNI inclusion
    OPEN_NI_INCLUDE = $$(OPEN_NI_INCLUDE)
    !isEmpty (OPEN_NI_INCLUDE) {
        INCLUDEPATH += "$$(OPEN_NI_INCLUDE)"
        OPEN_NI_LIB = $$(OPEN_NI_LIB)
        !isEmpty (OPEN_NI_LIB) {
            LIBS += "$$(OPEN_NI_LIB)/openNI.lib"
        } else {
            error("OpenNI library was not linked! Add OPEN_NI_LIB to the compilation environment")
        }
    } else {
        error("OpenNI headers were not included! Add OPEN_NI_INCLUDE to the compilation environment")
    }

    # Check for NITE inclusion
    NITE_INCLUDE = $$(NITE_INCLUDE)
    !isEmpty (NITE_INCLUDE) {
        INCLUDEPATH += "$$(NITE_INCLUDE)"
        NITE_LIB = $$(NITE_LIB)
        !isEmpty (NITE_LIB) {
            NITE_LIB_NAME = $$(NITE_LIB_NAME)
            !isEmpty (NITE_LIB_NAME) {
                LIBS += "$$(NITE_LIB)/$$(NITE_LIB_NAME)"
            } else {
                error("NITE libary was not named! Add NITE_LIB_NAME to the compilation environment")
            }
        } else {
            error("NITE library was not linked! Add NITE_LIB to the compilation environment")
        }
    } else {
        error("NITE headers were not included! Add NITE_INCLUDE to the compilation environment")
    }
}
#contains (DEFINES, KINECT) {
#    LIBS += "C:/Program Files/OpenNI/Lib/openNI.lib" "C:/Program Files/PrimeSense/NITE/Lib/XnVNITE_1_4_1.lib"
#    CONFIG(debug, debug|release) {
#        message("Linking Debug Kinect")
#        LIBS += "C:/Projects/Kinect-New-build-desktop/debug/Kinect.lib"
#    } else {
#        message("Linking Release Kinect")
#        LIBS += "C:/Projects/Kinect-New-build-desktop/release/Kinect.lib"
#    }
#    INCLUDEPATH += "$(OPEN_NI_INCLUDE)" "C:/Program Files/PrimeSense/NITE/Include" "C:/Projects/Kinect-New"
#}

WIIMOTE_CHECK = $$(WIIMOTE)
!isEmpty(WIIMOTE_CHECK) {
    DEFINES *= WIIMOTE
}

# Wiimote
contains (DEFINES, WIIMOTE) {
    message("Building with Wiimote support")

    WINDOWSSDKDIR = $$(WINDOWSSDKDIR)
    !isEmpty (WINDOWSSDKDIR) {
        INCLUDEPATH += "$$(WINDOWSSDKDIR)/Include"
    } else {
        error("Windows SDK 7.1 headers were not included! Add WINDOWSSDKDIR to the compilation environment (ex: C:/Program Files/Microsoft SDKs/Windows/v7.1)")
    }

    VCINSTALLDIR = $$(VCINSTALLDIR)
    !isEmpty (VCINSTALLDIR) {
        INCLUDEPATH += "$$(VCINSTALLDIR)/include" "$$(VCINSTALLDIR)/itlmfc/include"
    } else {
        error("Visual C 9.0 headers were not included! Add VCINSTALLDIR to the compilation environment (ex: C:/Program Files/Microsoft Visual Studio 9.0/VC)")
    }

    WINDDK_DIR = $$(WINDDK_DIR)
    !isEmpty (WINDDK_DIR) {
        INCLUDEPATH += "$$(WINDDK_DIR)/inc/api" "$$(WINDDK_DIR)/inc/ddk"
        LIBS += "$$(WINDDK_DIR)/lib/win7/i386/setupapi.lib" "$$(WINDDK_DIR)/lib/win7/i386/winmm.lib" "$$(WINDDK_DIR)/lib/win7/i386/hid.lib"
    } else {
        error("WinDDK headers and libraries were not included! Add WINDDK_DIR to the compilation environment (ex: /WinDDK/<version>)")
    }

    # Check for qWiimote inclusion
    WIIMOTE_INCLUDE = $$(WIIMOTE_INCLUDE)
    !isEmpty (WIIMOTE_INCLUDE) {
        INCLUDEPATH += "$$(WIIMOTE_INCLUDE)"
        WIIMOTE_LIB = $$(WIIMOTE_LIB)
        !isEmpty (WIIMOTE_LIB) {
            LIBS += "$$(WIIMOTE_LIB)/qWiimote.lib"
        } else {
            error("Wiimote library was not linked! Add WIIMOTE_LIB to the compilation environment")
        }
    } else {
        error("Wiimote headers were not included! Add WIIMOTE_INCLUDE to the compilation environment")
    }

    # VS Includes
    #INCLUDEPATH += "C:/Program Files/Microsoft SDKs/Windows/v7.1/Include" "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" "C:/Program Files/Microsoft Visual Studio 9.0/VC/itlmfc/include"
    # WiiMote
    #LIBS += "C:/WinDDK/7600.16385.1/lib/win7/i386/setupapi.lib" "C:/WinDDK/7600.16385.1/lib/win7/i386/winmm.lib" "C:/WinDDK/7600.16385.1/lib/win7/i386/hid.lib"
    #INCLUDEPATH += "C:/WinDDK/7600.16385.1/inc/api" "C:/WinDDK/7600.16385.1/inc/ddk"
    #
    # qWiimote
    #CONFIG(debug, debug|release) {
    #    message("Linking Debug Wiimote")
    #    LIBS += "C:/Projects/qWiimote-build-desktop/debug/qWiimote.lib"
    #} else {
    #    message("Linking Release Wiimote")
    #    LIBS += "C:/Projects/qWiimote-build-desktop/release/qWiimote.lib"
    #}
    #INCLUDEPATH += "C:/Projects/qWiimote"
}

TROY_DRIVER_CHECK = $$(TROY_DRIVER)
!isEmpty (TROY_DRIVER_CHECK) {
    DEFINES *= TROY_DRIVER
}

# Troy Driver
contains (DEFINES, TROY_DRIVER) {
    message("Building with physical support for Troy")

    TROY_DRIVER_INCLUDE = $$(TROY_DRIVER_INCLUDE)
    !isEmpty (TROY_DRIVER_INCLUDE) {
        INCLUDEPATH += "$$(TROY_DRIVER_INCLUDE)"
        TROY_DRIVER_LIB = $$(TROY_DRIVER_LIB)
        !isEmpty (TROY_DRIVER_LIB) {
            LIBS += "$$(TROY_DRIVER_LIB)/TroyInterface.lib"
        } else {
            error("Troy driver library was not linked! Add TROY_DRIVER_LIB to the compilation environment")
        }
    } else {
        error("Troy driver headers were not included! Add TROY_DRIVER_INCLUDE to the compilation environment")
    }

    QEXTSERIALPORT_INCLUDE = $$(QEXTSERIALPORT_INCLUDE)
    !isEmpty (QEXTSERIALPORT_INCLUDE) {
        INCLUDEPATH += "$$(QEXTSERIALPORT_INCLUDE)"
        QEXTSERIALPORT_LIB = $$(QEXTSERIALPORT_LIB)
        !isEmpty (QEXTSERIALPORT_LIB) {
            CONFIG(debug, debug|release) {
                LIBS += "$$(QEXTSERIALPORT_LIB)/qextserialportd.lib"
            } else {
                LIBS += "$$(QEXTSERIALPORT_LIB)/qextserialport.lib"
            }
        } else {
            error("QExtSerialPort library was not linked! Add QEXTSERIALPORT_LIB to the compilation environment")
        }
    } else {
        error("QExtSerialPort headers were not included! Add QEXTSERIALPORT_INCLUDE to the compilation environment")
    }

    QTSOURCE_DIR = $$(QTSOURCE_DIR)
    !isEmpty (QTSOURCE_DIR) {
        INCLUDEPATH += "$$(QTSOURCE_DIR)"
    } else {
        error("Qt source headers were not included! Add QTSOURCE_DIR to the compilation environment (ex: /QtSource/src)")
    }

    # TroyDriver Includes
    #INCLUDEPATH += "C:/Projects/TroyInterface"
    # To load QExtSerialPort and related headers
    #INCLUDEPATH += "C:/Projects/qextserialport/src"
    # To load the private header files used by QExtSerialPort, I had to download the Qt source code repository, and then add its
    # headers to the include path
    # Any references to files from this path must then be explicitly path'd, so that they can be found.
    #INCLUDEPATH += "C:/QtSource4.7/src"
    # SQL support (not quite sure why, but its a dependency, so why not)
    #QT += sql

    #CONFIG(debug, debug|release) {
    #    message("Linking Debug Troy Interface")
    #    LIBS += "C:/Projects/TroyInterface-build-desktop/debug/TroyInterface.lib"
    #    # Link to the debug qextserialport library, as built on Tyler's machine
    #    LIBS += "C:/Projects/qextserialport/src-build-desktop/build/qextserialportd.lib"
    #} else {
    #    message("Linking Release Troy Interface")
    #    LIBS += "C:/Projects/TroyInterface-build-desktop/release/TroyInterface.lib"
    #    # Link to the qextserialport library, as built on Tyler's machine
    #    LIBS += "C:/Projects/qextserialport/src-build-desktop/build/qextserialport.lib"
    #}
}

SOURCES += main.cpp \
    mainwindow.cpp \
    src/Core/history.cpp \
    src/Core/Robot/robot.cpp \
    src/Core/Robot/robotcomponent.cpp \
    src/Core/Robot/robotjointgroup.cpp \
    src/Core/Robot/robotsegment.cpp \
    src/Core/Animation/robotaction.cpp \
    src/Core/Animation/robotjointmotiontrack.cpp \
    src/Core/Animation/robotmotiontrack.cpp \
    src/Core/Robot/Troy/troy.cpp \
    src/Core/Robot/Troy/troycontroller.cpp \
    src/Core/Animation/actionfileparser.cpp \
    src/GUI/opengldisplay.cpp \
    src/GUI/robotglcontroller.cpp \
    src/GUI/editslider.cpp \
    src/GUI/robotsliderview.cpp \
    src/GUI/Troy/troyglcontroller.cpp \
    src/GUI/Troy/troyglview.cpp \
    src/GUI/Troy/troyframe.cpp \
    src/Core/Animation/actionfilewriter.cpp \
    src/Core/Animation/soundtrack.cpp \
    src/GUI/actiontimeline.cpp \
    src/GUI/keyframedialog.cpp \
    src/GUI/newactiondialog.cpp \
    src/Core/Commands/actioncommands.cpp \
    src/Core/Commands/robotcommands.cpp \
    src/GUI/audiodialog.cpp \
    src/GUI/editabletimelineitem.cpp \
    src/GUI/kinect/kinectkeyframedialog.cpp \
    src/GUI/kinect/kinectcalibrationdialog.cpp \
    src/GUI/kinect/kinectdialog.cpp \
    src/GUI/wiimote/wiimotestatusdialog.cpp \
    src/global.cpp \
#    src/GUI/kinect/kinectsnapshotrecorderdialog.cpp \
#    src/GUI/kinect/kinectsnapshotsetframe.cpp \
    src/GUI/wiimote/wiimotewidget.cpp \
#    src/GUI/kinect/kinectsnapshotrecorderframe.cpp \
    src/GUI/layouts/flowlayout.cpp \
    src/GUI/kinect/kinectstreamrecorderdialog.cpp \
    src/Core/Animation/facialtrack.cpp \
    src/qlog.cpp \
    src/Ebn/RobotController.cpp \
    ctrldialog.cpp \
    src/Ebn/EbnMonitor.cpp \
    src/Ebn/dialog.cpp

HEADERS += mainwindow.h \
    inc/global.h \
    inc/Core/history.h \
    inc/Core/visitor.h \
    inc/Core/visitable.h \
    inc/Core/Robot/robot.h \
    inc/Core/Robot/robotcomponent.h \
    inc/Core/Robot/robotjointgroup.h \
    inc/Core/Robot/robotsegment.h \
    inc/Core/Robot/robotvisitor.h \
    inc/Core/Robot/Troy/troy.h \
    inc/Core/Robot/Troy/troycontroller.h \
    inc/Core/Commands/command.h \
    inc/Core/Commands/robotcommands.h \
    inc/Core/Animation/actionfileparser.h \
    inc/Core/Animation/robotaction.h \
    inc/Core/Animation/robotjointmotiontrack.h \
    inc/Core/Animation/robotmotiontrack.h \
    inc/GUI/editslider.h \
    inc/GUI/robotsliderview.h \
    inc/GUI/opengldisplay.h \
    inc/GUI/robotglcontroller.h \
    inc/GUI/nullglcontroller.h \
    inc/GUI/Troy/troyglcontroller.h \
    inc/GUI/Troy/troyglview.h \
    inc/GUI/Troy/troyframe.h \
    inc/Core/Animation/actionfilewriter.h \
    inc/Core/Animation/soundtrack.h \
    inc/GUI/actiontimeline.h \
    inc/Core/Commands/actioncommands.h \
    inc/GUI/keyframedialog.h \
    inc/GUI/newactiondialog.h \
    inc/Core/Robot/nullbot.h \
    inc/GUI/audiodialog.h\
    inc/Core/Robot/nullbot.h \
    inc/GUI/editabletimelineitem.h \
    inc/Core/Animation/actiontrack.h \
    inc/GUI/kinect/kinectkeyframedialog.h \
    inc/GUI/kinect/kinectcalibrationdialog.h \
    inc/GUI/kinect/kinectdialog.h \
    inc/GUI/wiimote/wiimotestatusdialog.h \
 #   inc/GUI/kinect/kinectsnapshotrecorderdialog.h \
 #   inc/GUI/kinect/kinectsnapshotsetframe.h \
    inc/GUI/wiimote/wiimotewidget.h \
 #   inc/GUI/kinect/kinectsnapshotrecorderframe.h \
    inc/GUI/layouts/flowlayout.h \
    inc/GUI/kinect/kinectstreamrecorderdialog.h \
    inc/Core/Animation/facialtrack.h \
    inc/qlog.h \
    inc/Ebn/RobotController.h \
    ctrldialog.h \
    inc/Ebn/EbnMonitor.h \
    inc/Ebn/dialog.h

FORMS += mainwindow.ui \
    forms/editslider.ui \
    forms/keyframedialog.ui \
    forms/newactiondialog.ui \
    forms/audiodialog.ui \
    forms/kinect/kinectkeyframedialog.ui \
    forms/kinect/kinectcalibrationdialog.ui \
    forms/wiimote/wiimotestatusdialog.ui \
    forms/kinect/kinectsnapshotrecorderdialog.ui \
    forms/kinect/kinectsnapshotsetframe.ui \
    forms/kinect/kinectsnapshotrecorderframe.ui \
    forms/kinect/kinectstreamrecorderdialog.ui \
    forms/keyframeeditform.ui \
    ctrldialog.ui \
    forms/dialog.ui

INCLUDEPATH += inc \
    inc/Core \
    inc/Core/Robot \
    inc/Core/Robot/Troy \
    inc/Core/Commands \
    inc/Core/Animation \
    inc/GUI \
    inc/GUI/Troy \
    inc/Ebn

RESOURCES += \
    resources.qrc



